Skip to main content

触发站点临时任务

你可以使用机器人开放API v2alpha1触发S系列机器人的现场任务。

触发S系列机器人站点任务流程图

指令列表

curl --location 'https://openapi.gs-robot.com/openapi/v2alpha1/s/robots/{robotSn}/status'
--header 'Content-Type: application/json' 
--header 'Authorization: Bearer {{token}}'
curl --location 'https://openapi.gs-robot.com/openapi/v2alpha1/robots/{robotSn}/getSiteInfo' 
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {{token}}'
curl --location 'https://openapi.staging.gs-robot.com/openapi/v2alpha1/site/submitTask' 
--header 'Content-Type: application/json' 
--header 'Authorization: Bearer {{token}}' 
--data '{
    "cleaningMode": "清扫",
    "loopCount": 1,
    "siteId": "84c5535d-aeb2-11ee-a80f-8538ffbd60ad",
    "siteName": "AIO-1.1-S-floor-01",
    "taskName": "area1",
    "floors": [
        {
            "index": 11,
            "name": "10",
            "mapId": "86c2598d-5c9d-437b-92e0-ef1aafd01cfd",
            "area": {
                "id": "1",
                "name": "area1"
            }
        }
    ],
    "tasks": [
        {
            "mapId": "86c2598d-5c9d-437b-92e0-ef1aafd01cfd",
            "subTasks": [
                {
                    "mapId": "86c2598d-5c9d-437b-92e0-ef1aafd01cfd",
                    "areaId": "1"
                }
            ]
        }
    ],
    "serialNumber": "{robotSn}"
}'
curl --location 'https://openapi.gs-robot.com/v2alpha1/robotCommand/tempTask:send' 
--header 'Content-Type: application/json' 
--header 'Authorization: Bearer {{token}}' 
--data '{
  "productId": "{robotSn}",
  "tempTaskCommand": {
    "taskName": "area1",
    "cleaningMode": "清扫",
    "loop": "true",
    "loopCount": "1",
    "mapName": "10f_cloud",
    "startParam": {
      "mapId": "2762e44d-8a90-11ee-8adf-4d6cf3b8dbc5",
      "areaId": "area1"
    }
  }
}'